package com.study.zzedu.ui.graduateservice;


import android.content.Context;

import com.study.zzedu.base.BasePresenter;
import com.study.zzedu.http.OnResultListener;
import com.study.zzedu.ui.graduateservice.GraduateServiceContract;
import com.study.zzedu.ui.graduateservice.GraduateServiceModel;

public class GraduateServicePresenter extends BasePresenter<GraduateServiceContract.IView> {

    private GraduateServiceModel pwdModel;

    public GraduateServicePresenter() {
        this.pwdModel = new GraduateServiceModel();
    }

    //学生查询申请学位条件
    public void queryApplyConditions(Context context) {
        pwdModel.queryApplyConditions(context, new OnResultListener() {
            @Override
            public void onSuccess(String result) {
                getView().getDataList(result);
            }

            @Override
            public void onError(String error) {
                getView().showError(error);
            }
        });
    }

    //学生申请学位
    public void applyXueWei(Context context) {
        pwdModel.applyXueWei(context,new OnResultListener() {
            @Override
            public void onSuccess(String result) {
                getView().getApplyReturn("");
            }

            @Override
            public void onError(String error) {
                getView().showError(error);
            }
        });
    }

}
